<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 无参函数 求两个数的和(10+20)
        function sum() {
            var a = 10;
            var b = 20;
            var c = a + b;
            console.log("求两个数的和(10+20):",c);
        }
        // 无参函数 求1~100的和
        function sum1() {
            var sum = 0;
            for (var i = 1; i <= 100; i++) {
                sum += i;

            }
            console.log("求1~100的和:",sum);
        }
        sum();
        sum1();
        

    </script>
</body>

</html>